/* import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:image_crop/image_crop.dart';
import 'package:image_cropper/image_cropper.dart';

class CropImageRoute extends StatefulWidget {
  CropImageRoute(this.image);

  final File image; //原始图片路径

  @override
  _CropImageRouteState createState() => new _CropImageRouteState();
}

class _CropImageRouteState extends State<CropImageRoute> {
  double baseLeft; //图片左上角的x坐标
  double baseTop; //图片左上角的y坐标
  double imageWidth; //图片宽度，缩放后会变化
  double imageScale = 1; //图片缩放比例
  Image imageView;
  final cropKey = GlobalKey<CropState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Container(
      height: ScreenUtil().screenHeight,
      width: ScreenUtil().screenWidth,
      color: Colors.red,
      child: Column(
        children: <Widget>[
          Container(
            height: ScreenUtil().screenHeight * 0.8,
            width: ScreenUtil().screenWidth * 0.5,
            color: Colors.blue,
            child: Crop.file(
              widget.image,
              key: cropKey,
              aspectRatio: 1.0,
              alwaysShowGrid: true,
            ),
          ),
          RaisedButton(
            onPressed: () {
              _crop(widget.image);
            },
            child: Text('ok'),
          ),
        ],
      ),
    ));
  }

 

  ///上传头像
  void upload(File file) {
    /* print(file.path);
    Dio dio = Dio();
    dio
        .post("http://your ip:port/",
            data: FormData.from({'file': file}))
        .then((response) {
      if (!mounted) {
        return;
      }
      //处理上传结果
      UploadIconResult bean = UploadIconResult(response.data);
      print('上传头像结果 $bean');
      if (bean.code == '1') {
        Navigator.pop(context, bean.data.url);//这里的url在上一页调用的result可以拿到
      } else {
        Navigator.pop(context, '');
      }
    }); */
  }
}
 */